package com.yonglian.system.service.impl;

import java.util.List;
import com.yonglian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yonglian.system.mapper.CmsActivityStandardMapper;
import com.yonglian.system.domain.CmsActivityStandard;
import com.yonglian.system.service.ICmsActivityStandardService;
import com.yonglian.common.core.text.Convert;

/**
 * 活动标准Service业务层处理
 * 
 * @author gyok
 * @date 2024-05-28
 */
@Service
public class CmsActivityStandardServiceImpl implements ICmsActivityStandardService 
{
    @Autowired
    private CmsActivityStandardMapper cmsActivityStandardMapper;

    /**
     * 查询活动标准
     * 
     * @param id 活动标准主键
     * @return 活动标准
     */
    @Override
    public CmsActivityStandard selectCmsActivityStandardById(Long id)
    {
        return cmsActivityStandardMapper.selectCmsActivityStandardById(id);
    }

    /**
     * 查询活动标准列表
     * 
     * @param cmsActivityStandard 活动标准
     * @return 活动标准
     */
    @Override
    public List<CmsActivityStandard> selectCmsActivityStandardList(CmsActivityStandard cmsActivityStandard)
    {
        return cmsActivityStandardMapper.selectCmsActivityStandardList(cmsActivityStandard);
    }

    /**
     * 新增活动标准
     * 
     * @param cmsActivityStandard 活动标准
     * @return 结果
     */
    @Override
    public int insertCmsActivityStandard(CmsActivityStandard cmsActivityStandard)
    {
        cmsActivityStandard.setCreateTime(DateUtils.getNowDate());
        return cmsActivityStandardMapper.insertCmsActivityStandard(cmsActivityStandard);
    }

    /**
     * 修改活动标准
     * 
     * @param cmsActivityStandard 活动标准
     * @return 结果
     */
    @Override
    public int updateCmsActivityStandard(CmsActivityStandard cmsActivityStandard)
    {
        return cmsActivityStandardMapper.updateCmsActivityStandard(cmsActivityStandard);
    }

    /**
     * 批量删除活动标准
     * 
     * @param ids 需要删除的活动标准主键
     * @return 结果
     */
    @Override
    public int deleteCmsActivityStandardByIds(String ids)
    {
        return cmsActivityStandardMapper.deleteCmsActivityStandardByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动标准信息
     * 
     * @param id 活动标准主键
     * @return 结果
     */
    @Override
    public int deleteCmsActivityStandardById(Long id)
    {
        return cmsActivityStandardMapper.deleteCmsActivityStandardById(id);
    }
}
